//
//  AXFLeftTableViewCell.m
//  闪电超市
//
//  Created by 李典 on 16/11/4.
//  Copyright © 2016年 李典. All rights reserved.
//

#import "AXFLeftTableViewCell.h"

@implementation AXFLeftTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}
- (void)setupUI
{
    // 正常背景颜色
    self.contentView.backgroundColor = [UIColor cz_colorWithHex:0xf8f8f8];
    self.textLabel.font = [UIFont systemFontOfSize:12];
    self.textLabel.textColor = [UIColor cz_colorWithHex:0x949494];
    
    // 设置选中颜色
    UIView *selectView = [[UIView alloc]init];
    selectView.backgroundColor = [UIColor whiteColor];
    self.selectedBackgroundView = selectView;
    
    //小黄条
    UIView *yellowView = [[UIView alloc]init];
    yellowView.backgroundColor = [UIColor cz_colorWithHex:0xff8a00];
    [selectView addSubview:yellowView];
    
    //热门
    //    UILabel *hotLable = [[UILabel alloc]init];
    //    hotLable.text = @"hot";
    //    hotLable.backgroundColor = [UIColor cz_colorWithHex:0xff8a00];
    ////    [self.contentView.layer addSublayer:(CALayer *)hotLable];
    
    //分割线
    UIView *separateLine = [[UIView alloc]init];
    
    separateLine.backgroundColor = [UIColor cz_colorWithHex:0xf3f3f3];
    //    separateLine.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:separateLine];
    
    [yellowView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(selectView);
        make.width.mas_equalTo(6);
        make.height.mas_equalTo(35);
        make.centerY.equalTo(selectView);
    }];
    [separateLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self.contentView);
        make.height.mas_equalTo(1);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(1);
    }];
    //    [hotLable mas_makeConstraints:^(MASConstraintMaker *make) {
    //        make.top.right.equalTo(self.contentView);
    //
    //    }];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}

@end
